(0) Obligation:

Clauses:

sameleaves(leaf(L), leaf(L)).
sameleaves(tree(T1, T2), tree(S1, S2)) :- ','(getleave(T1, T2, L, T), ','(getleave(S1, S2, L, S), sameleaves(T, S))).
getleave(leaf(A), C, A, C).
getleave(tree(A, B), C, L, O) :- getleave(A, tree(B, C), L, O).

Query: sameleaves(g,g)

(1) PrologToPiTRSProof (SOUND transformation)

We use the technique of [TOCL09]. With regard to the inferred argument filtering the predicates were used in the following modes:
sameleaves_in: (b,b)
getleave_in: (b,b,f,f) (b,b,b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

sameleaves_in_gg(leaf(L), leaf(L)) → sameleaves_out_gg(leaf(L), leaf(L))
sameleaves_in_gg(tree(T1, T2), tree(S1, S2)) → U1_gg(T1, T2, S1, S2, getleave_in_ggaa(T1, T2, L, T))
getleave_in_ggaa(leaf(A), C, A, C) → getleave_out_ggaa(leaf(A), C, A, C)
getleave_in_ggaa(tree(A, B), C, L, O) → U4_ggaa(A, B, C, L, O, getleave_in_ggaa(A, tree(B, C), L, O))
U4_ggaa(A, B, C, L, O, getleave_out_ggaa(A, tree(B, C), L, O)) → getleave_out_ggaa(tree(A, B), C, L, O)
U1_gg(T1, T2, S1, S2, getleave_out_ggaa(T1, T2, L, T)) → U2_gg(T1, T2, S1, S2, T, getleave_in_ggga(S1, S2, L, S))
getleave_in_ggga(leaf(A), C, A, C) → getleave_out_ggga(leaf(A), C, A, C)
getleave_in_ggga(tree(A, B), C, L, O) → U4_ggga(A, B, C, L, O, getleave_in_ggga(A, tree(B, C), L, O))
U4_ggga(A, B, C, L, O, getleave_out_ggga(A, tree(B, C), L, O)) → getleave_out_ggga(tree(A, B), C, L, O)
U2_gg(T1, T2, S1, S2, T, getleave_out_ggga(S1, S2, L, S)) → U3_gg(T1, T2, S1, S2, sameleaves_in_gg(T, S))
U3_gg(T1, T2, S1, S2, sameleaves_out_gg(T, S)) → sameleaves_out_gg(tree(T1, T2), tree(S1, S2))

The argument filtering Pi contains the following mapping:
sameleaves_in_gg(x1, x2)  =  sameleaves_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleaves_out_gg(x1, x2)  =  sameleaves_out_gg
tree(x1, x2)  =  tree(x1, x2)
U1_gg(x1, x2, x3, x4, x5)  =  U1_gg(x3, x4, x5)
getleave_in_ggaa(x1, x2, x3, x4)  =  getleave_in_ggaa(x1, x2)
getleave_out_ggaa(x1, x2, x3, x4)  =  getleave_out_ggaa(x3, x4)
U4_ggaa(x1, x2, x3, x4, x5, x6)  =  U4_ggaa(x6)
U2_gg(x1, x2, x3, x4, x5, x6)  =  U2_gg(x5, x6)
getleave_in_ggga(x1, x2, x3, x4)  =  getleave_in_ggga(x1, x2, x3)
getleave_out_ggga(x1, x2, x3, x4)  =  getleave_out_ggga(x4)
U4_ggga(x1, x2, x3, x4, x5, x6)  =  U4_ggga(x6)
U3_gg(x1, x2, x3, x4, x5)  =  U3_gg(x5)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(2) Obligation:

Pi-finite rewrite system:
The TRS R consists of the following rules:

sameleaves_in_gg(leaf(L), leaf(L)) → sameleaves_out_gg(leaf(L), leaf(L))
sameleaves_in_gg(tree(T1, T2), tree(S1, S2)) → U1_gg(T1, T2, S1, S2, getleave_in_ggaa(T1, T2, L, T))
getleave_in_ggaa(leaf(A), C, A, C) → getleave_out_ggaa(leaf(A), C, A, C)
getleave_in_ggaa(tree(A, B), C, L, O) → U4_ggaa(A, B, C, L, O, getleave_in_ggaa(A, tree(B, C), L, O))
U4_ggaa(A, B, C, L, O, getleave_out_ggaa(A, tree(B, C), L, O)) → getleave_out_ggaa(tree(A, B), C, L, O)
U1_gg(T1, T2, S1, S2, getleave_out_ggaa(T1, T2, L, T)) → U2_gg(T1, T2, S1, S2, T, getleave_in_ggga(S1, S2, L, S))
getleave_in_ggga(leaf(A), C, A, C) → getleave_out_ggga(leaf(A), C, A, C)
getleave_in_ggga(tree(A, B), C, L, O) → U4_ggga(A, B, C, L, O, getleave_in_ggga(A, tree(B, C), L, O))
U4_ggga(A, B, C, L, O, getleave_out_ggga(A, tree(B, C), L, O)) → getleave_out_ggga(tree(A, B), C, L, O)
U2_gg(T1, T2, S1, S2, T, getleave_out_ggga(S1, S2, L, S)) → U3_gg(T1, T2, S1, S2, sameleaves_in_gg(T, S))
U3_gg(T1, T2, S1, S2, sameleaves_out_gg(T, S)) → sameleaves_out_gg(tree(T1, T2), tree(S1, S2))

The argument filtering Pi contains the following mapping:
sameleaves_in_gg(x1, x2)  =  sameleaves_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleaves_out_gg(x1, x2)  =  sameleaves_out_gg
tree(x1, x2)  =  tree(x1, x2)
U1_gg(x1, x2, x3, x4, x5)  =  U1_gg(x3, x4, x5)
getleave_in_ggaa(x1, x2, x3, x4)  =  getleave_in_ggaa(x1, x2)
getleave_out_ggaa(x1, x2, x3, x4)  =  getleave_out_ggaa(x3, x4)
U4_ggaa(x1, x2, x3, x4, x5, x6)  =  U4_ggaa(x6)
U2_gg(x1, x2, x3, x4, x5, x6)  =  U2_gg(x5, x6)
getleave_in_ggga(x1, x2, x3, x4)  =  getleave_in_ggga(x1, x2, x3)
getleave_out_ggga(x1, x2, x3, x4)  =  getleave_out_ggga(x4)
U4_ggga(x1, x2, x3, x4, x5, x6)  =  U4_ggga(x6)
U3_gg(x1, x2, x3, x4, x5)  =  U3_gg(x5)

(3) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

SAMELEAVES_IN_GG(tree(T1, T2), tree(S1, S2)) → U1_GG(T1, T2, S1, S2, getleave_in_ggaa(T1, T2, L, T))
SAMELEAVES_IN_GG(tree(T1, T2), tree(S1, S2)) → GETLEAVE_IN_GGAA(T1, T2, L, T)
GETLEAVE_IN_GGAA(tree(A, B), C, L, O) → U4_GGAA(A, B, C, L, O, getleave_in_ggaa(A, tree(B, C), L, O))
GETLEAVE_IN_GGAA(tree(A, B), C, L, O) → GETLEAVE_IN_GGAA(A, tree(B, C), L, O)
U1_GG(T1, T2, S1, S2, getleave_out_ggaa(T1, T2, L, T)) → U2_GG(T1, T2, S1, S2, T, getleave_in_ggga(S1, S2, L, S))
U1_GG(T1, T2, S1, S2, getleave_out_ggaa(T1, T2, L, T)) → GETLEAVE_IN_GGGA(S1, S2, L, S)
GETLEAVE_IN_GGGA(tree(A, B), C, L, O) → U4_GGGA(A, B, C, L, O, getleave_in_ggga(A, tree(B, C), L, O))
GETLEAVE_IN_GGGA(tree(A, B), C, L, O) → GETLEAVE_IN_GGGA(A, tree(B, C), L, O)
U2_GG(T1, T2, S1, S2, T, getleave_out_ggga(S1, S2, L, S)) → U3_GG(T1, T2, S1, S2, sameleaves_in_gg(T, S))
U2_GG(T1, T2, S1, S2, T, getleave_out_ggga(S1, S2, L, S)) → SAMELEAVES_IN_GG(T, S)

The TRS R consists of the following rules:

sameleaves_in_gg(leaf(L), leaf(L)) → sameleaves_out_gg(leaf(L), leaf(L))
sameleaves_in_gg(tree(T1, T2), tree(S1, S2)) → U1_gg(T1, T2, S1, S2, getleave_in_ggaa(T1, T2, L, T))
getleave_in_ggaa(leaf(A), C, A, C) → getleave_out_ggaa(leaf(A), C, A, C)
getleave_in_ggaa(tree(A, B), C, L, O) → U4_ggaa(A, B, C, L, O, getleave_in_ggaa(A, tree(B, C), L, O))
U4_ggaa(A, B, C, L, O, getleave_out_ggaa(A, tree(B, C), L, O)) → getleave_out_ggaa(tree(A, B), C, L, O)
U1_gg(T1, T2, S1, S2, getleave_out_ggaa(T1, T2, L, T)) → U2_gg(T1, T2, S1, S2, T, getleave_in_ggga(S1, S2, L, S))
getleave_in_ggga(leaf(A), C, A, C) → getleave_out_ggga(leaf(A), C, A, C)
getleave_in_ggga(tree(A, B), C, L, O) → U4_ggga(A, B, C, L, O, getleave_in_ggga(A, tree(B, C), L, O))
U4_ggga(A, B, C, L, O, getleave_out_ggga(A, tree(B, C), L, O)) → getleave_out_ggga(tree(A, B), C, L, O)
U2_gg(T1, T2, S1, S2, T, getleave_out_ggga(S1, S2, L, S)) → U3_gg(T1, T2, S1, S2, sameleaves_in_gg(T, S))
U3_gg(T1, T2, S1, S2, sameleaves_out_gg(T, S)) → sameleaves_out_gg(tree(T1, T2), tree(S1, S2))

The argument filtering Pi contains the following mapping:
sameleaves_in_gg(x1, x2)  =  sameleaves_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleaves_out_gg(x1, x2)  =  sameleaves_out_gg
tree(x1, x2)  =  tree(x1, x2)
U1_gg(x1, x2, x3, x4, x5)  =  U1_gg(x3, x4, x5)
getleave_in_ggaa(x1, x2, x3, x4)  =  getleave_in_ggaa(x1, x2)
getleave_out_ggaa(x1, x2, x3, x4)  =  getleave_out_ggaa(x3, x4)
U4_ggaa(x1, x2, x3, x4, x5, x6)  =  U4_ggaa(x6)
U2_gg(x1, x2, x3, x4, x5, x6)  =  U2_gg(x5, x6)
getleave_in_ggga(x1, x2, x3, x4)  =  getleave_in_ggga(x1, x2, x3)
getleave_out_ggga(x1, x2, x3, x4)  =  getleave_out_ggga(x4)
U4_ggga(x1, x2, x3, x4, x5, x6)  =  U4_ggga(x6)
U3_gg(x1, x2, x3, x4, x5)  =  U3_gg(x5)
SAMELEAVES_IN_GG(x1, x2)  =  SAMELEAVES_IN_GG(x1, x2)
U1_GG(x1, x2, x3, x4, x5)  =  U1_GG(x3, x4, x5)
GETLEAVE_IN_GGAA(x1, x2, x3, x4)  =  GETLEAVE_IN_GGAA(x1, x2)
U4_GGAA(x1, x2, x3, x4, x5, x6)  =  U4_GGAA(x6)
U2_GG(x1, x2, x3, x4, x5, x6)  =  U2_GG(x5, x6)
GETLEAVE_IN_GGGA(x1, x2, x3, x4)  =  GETLEAVE_IN_GGGA(x1, x2, x3)
U4_GGGA(x1, x2, x3, x4, x5, x6)  =  U4_GGGA(x6)
U3_GG(x1, x2, x3, x4, x5)  =  U3_GG(x5)

We have to consider all (P,R,Pi)-chains

(4) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

SAMELEAVES_IN_GG(tree(T1, T2), tree(S1, S2)) → U1_GG(T1, T2, S1, S2, getleave_in_ggaa(T1, T2, L, T))
SAMELEAVES_IN_GG(tree(T1, T2), tree(S1, S2)) → GETLEAVE_IN_GGAA(T1, T2, L, T)
GETLEAVE_IN_GGAA(tree(A, B), C, L, O) → U4_GGAA(A, B, C, L, O, getleave_in_ggaa(A, tree(B, C), L, O))
GETLEAVE_IN_GGAA(tree(A, B), C, L, O) → GETLEAVE_IN_GGAA(A, tree(B, C), L, O)
U1_GG(T1, T2, S1, S2, getleave_out_ggaa(T1, T2, L, T)) → U2_GG(T1, T2, S1, S2, T, getleave_in_ggga(S1, S2, L, S))
U1_GG(T1, T2, S1, S2, getleave_out_ggaa(T1, T2, L, T)) → GETLEAVE_IN_GGGA(S1, S2, L, S)
GETLEAVE_IN_GGGA(tree(A, B), C, L, O) → U4_GGGA(A, B, C, L, O, getleave_in_ggga(A, tree(B, C), L, O))
GETLEAVE_IN_GGGA(tree(A, B), C, L, O) → GETLEAVE_IN_GGGA(A, tree(B, C), L, O)
U2_GG(T1, T2, S1, S2, T, getleave_out_ggga(S1, S2, L, S)) → U3_GG(T1, T2, S1, S2, sameleaves_in_gg(T, S))
U2_GG(T1, T2, S1, S2, T, getleave_out_ggga(S1, S2, L, S)) → SAMELEAVES_IN_GG(T, S)

The TRS R consists of the following rules:

sameleaves_in_gg(leaf(L), leaf(L)) → sameleaves_out_gg(leaf(L), leaf(L))
sameleaves_in_gg(tree(T1, T2), tree(S1, S2)) → U1_gg(T1, T2, S1, S2, getleave_in_ggaa(T1, T2, L, T))
getleave_in_ggaa(leaf(A), C, A, C) → getleave_out_ggaa(leaf(A), C, A, C)
getleave_in_ggaa(tree(A, B), C, L, O) → U4_ggaa(A, B, C, L, O, getleave_in_ggaa(A, tree(B, C), L, O))
U4_ggaa(A, B, C, L, O, getleave_out_ggaa(A, tree(B, C), L, O)) → getleave_out_ggaa(tree(A, B), C, L, O)
U1_gg(T1, T2, S1, S2, getleave_out_ggaa(T1, T2, L, T)) → U2_gg(T1, T2, S1, S2, T, getleave_in_ggga(S1, S2, L, S))
getleave_in_ggga(leaf(A), C, A, C) → getleave_out_ggga(leaf(A), C, A, C)
getleave_in_ggga(tree(A, B), C, L, O) → U4_ggga(A, B, C, L, O, getleave_in_ggga(A, tree(B, C), L, O))
U4_ggga(A, B, C, L, O, getleave_out_ggga(A, tree(B, C), L, O)) → getleave_out_ggga(tree(A, B), C, L, O)
U2_gg(T1, T2, S1, S2, T, getleave_out_ggga(S1, S2, L, S)) → U3_gg(T1, T2, S1, S2, sameleaves_in_gg(T, S))
U3_gg(T1, T2, S1, S2, sameleaves_out_gg(T, S)) → sameleaves_out_gg(tree(T1, T2), tree(S1, S2))

The argument filtering Pi contains the following mapping:
sameleaves_in_gg(x1, x2)  =  sameleaves_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleaves_out_gg(x1, x2)  =  sameleaves_out_gg
tree(x1, x2)  =  tree(x1, x2)
U1_gg(x1, x2, x3, x4, x5)  =  U1_gg(x3, x4, x5)
getleave_in_ggaa(x1, x2, x3, x4)  =  getleave_in_ggaa(x1, x2)
getleave_out_ggaa(x1, x2, x3, x4)  =  getleave_out_ggaa(x3, x4)
U4_ggaa(x1, x2, x3, x4, x5, x6)  =  U4_ggaa(x6)
U2_gg(x1, x2, x3, x4, x5, x6)  =  U2_gg(x5, x6)
getleave_in_ggga(x1, x2, x3, x4)  =  getleave_in_ggga(x1, x2, x3)
getleave_out_ggga(x1, x2, x3, x4)  =  getleave_out_ggga(x4)
U4_ggga(x1, x2, x3, x4, x5, x6)  =  U4_ggga(x6)
U3_gg(x1, x2, x3, x4, x5)  =  U3_gg(x5)
SAMELEAVES_IN_GG(x1, x2)  =  SAMELEAVES_IN_GG(x1, x2)
U1_GG(x1, x2, x3, x4, x5)  =  U1_GG(x3, x4, x5)
GETLEAVE_IN_GGAA(x1, x2, x3, x4)  =  GETLEAVE_IN_GGAA(x1, x2)
U4_GGAA(x1, x2, x3, x4, x5, x6)  =  U4_GGAA(x6)
U2_GG(x1, x2, x3, x4, x5, x6)  =  U2_GG(x5, x6)
GETLEAVE_IN_GGGA(x1, x2, x3, x4)  =  GETLEAVE_IN_GGGA(x1, x2, x3)
U4_GGGA(x1, x2, x3, x4, x5, x6)  =  U4_GGGA(x6)
U3_GG(x1, x2, x3, x4, x5)  =  U3_GG(x5)

We have to consider all (P,R,Pi)-chains

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 3 SCCs with 5 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

GETLEAVE_IN_GGGA(tree(A, B), C, L, O) → GETLEAVE_IN_GGGA(A, tree(B, C), L, O)

The TRS R consists of the following rules:

sameleaves_in_gg(leaf(L), leaf(L)) → sameleaves_out_gg(leaf(L), leaf(L))
sameleaves_in_gg(tree(T1, T2), tree(S1, S2)) → U1_gg(T1, T2, S1, S2, getleave_in_ggaa(T1, T2, L, T))
getleave_in_ggaa(leaf(A), C, A, C) → getleave_out_ggaa(leaf(A), C, A, C)
getleave_in_ggaa(tree(A, B), C, L, O) → U4_ggaa(A, B, C, L, O, getleave_in_ggaa(A, tree(B, C), L, O))
U4_ggaa(A, B, C, L, O, getleave_out_ggaa(A, tree(B, C), L, O)) → getleave_out_ggaa(tree(A, B), C, L, O)
U1_gg(T1, T2, S1, S2, getleave_out_ggaa(T1, T2, L, T)) → U2_gg(T1, T2, S1, S2, T, getleave_in_ggga(S1, S2, L, S))
getleave_in_ggga(leaf(A), C, A, C) → getleave_out_ggga(leaf(A), C, A, C)
getleave_in_ggga(tree(A, B), C, L, O) → U4_ggga(A, B, C, L, O, getleave_in_ggga(A, tree(B, C), L, O))
U4_ggga(A, B, C, L, O, getleave_out_ggga(A, tree(B, C), L, O)) → getleave_out_ggga(tree(A, B), C, L, O)
U2_gg(T1, T2, S1, S2, T, getleave_out_ggga(S1, S2, L, S)) → U3_gg(T1, T2, S1, S2, sameleaves_in_gg(T, S))
U3_gg(T1, T2, S1, S2, sameleaves_out_gg(T, S)) → sameleaves_out_gg(tree(T1, T2), tree(S1, S2))

The argument filtering Pi contains the following mapping:
sameleaves_in_gg(x1, x2)  =  sameleaves_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleaves_out_gg(x1, x2)  =  sameleaves_out_gg
tree(x1, x2)  =  tree(x1, x2)
U1_gg(x1, x2, x3, x4, x5)  =  U1_gg(x3, x4, x5)
getleave_in_ggaa(x1, x2, x3, x4)  =  getleave_in_ggaa(x1, x2)
getleave_out_ggaa(x1, x2, x3, x4)  =  getleave_out_ggaa(x3, x4)
U4_ggaa(x1, x2, x3, x4, x5, x6)  =  U4_ggaa(x6)
U2_gg(x1, x2, x3, x4, x5, x6)  =  U2_gg(x5, x6)
getleave_in_ggga(x1, x2, x3, x4)  =  getleave_in_ggga(x1, x2, x3)
getleave_out_ggga(x1, x2, x3, x4)  =  getleave_out_ggga(x4)
U4_ggga(x1, x2, x3, x4, x5, x6)  =  U4_ggga(x6)
U3_gg(x1, x2, x3, x4, x5)  =  U3_gg(x5)
GETLEAVE_IN_GGGA(x1, x2, x3, x4)  =  GETLEAVE_IN_GGGA(x1, x2, x3)

We have to consider all (P,R,Pi)-chains

(8) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(9) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

GETLEAVE_IN_GGGA(tree(A, B), C, L, O) → GETLEAVE_IN_GGGA(A, tree(B, C), L, O)

R is empty.
The argument filtering Pi contains the following mapping:
tree(x1, x2)  =  tree(x1, x2)
GETLEAVE_IN_GGGA(x1, x2, x3, x4)  =  GETLEAVE_IN_GGGA(x1, x2, x3)

We have to consider all (P,R,Pi)-chains

(10) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(11) Obligation:

Q DP problem:
The TRS P consists of the following rules:

GETLEAVE_IN_GGGA(tree(A, B), C, L) → GETLEAVE_IN_GGGA(A, tree(B, C), L)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(12) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • GETLEAVE_IN_GGGA(tree(A, B), C, L) → GETLEAVE_IN_GGGA(A, tree(B, C), L)
    The graph contains the following edges 1 > 1, 3 >= 3

(13) YES

(14) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

GETLEAVE_IN_GGAA(tree(A, B), C, L, O) → GETLEAVE_IN_GGAA(A, tree(B, C), L, O)

The TRS R consists of the following rules:

sameleaves_in_gg(leaf(L), leaf(L)) → sameleaves_out_gg(leaf(L), leaf(L))
sameleaves_in_gg(tree(T1, T2), tree(S1, S2)) → U1_gg(T1, T2, S1, S2, getleave_in_ggaa(T1, T2, L, T))
getleave_in_ggaa(leaf(A), C, A, C) → getleave_out_ggaa(leaf(A), C, A, C)
getleave_in_ggaa(tree(A, B), C, L, O) → U4_ggaa(A, B, C, L, O, getleave_in_ggaa(A, tree(B, C), L, O))
U4_ggaa(A, B, C, L, O, getleave_out_ggaa(A, tree(B, C), L, O)) → getleave_out_ggaa(tree(A, B), C, L, O)
U1_gg(T1, T2, S1, S2, getleave_out_ggaa(T1, T2, L, T)) → U2_gg(T1, T2, S1, S2, T, getleave_in_ggga(S1, S2, L, S))
getleave_in_ggga(leaf(A), C, A, C) → getleave_out_ggga(leaf(A), C, A, C)
getleave_in_ggga(tree(A, B), C, L, O) → U4_ggga(A, B, C, L, O, getleave_in_ggga(A, tree(B, C), L, O))
U4_ggga(A, B, C, L, O, getleave_out_ggga(A, tree(B, C), L, O)) → getleave_out_ggga(tree(A, B), C, L, O)
U2_gg(T1, T2, S1, S2, T, getleave_out_ggga(S1, S2, L, S)) → U3_gg(T1, T2, S1, S2, sameleaves_in_gg(T, S))
U3_gg(T1, T2, S1, S2, sameleaves_out_gg(T, S)) → sameleaves_out_gg(tree(T1, T2), tree(S1, S2))

The argument filtering Pi contains the following mapping:
sameleaves_in_gg(x1, x2)  =  sameleaves_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleaves_out_gg(x1, x2)  =  sameleaves_out_gg
tree(x1, x2)  =  tree(x1, x2)
U1_gg(x1, x2, x3, x4, x5)  =  U1_gg(x3, x4, x5)
getleave_in_ggaa(x1, x2, x3, x4)  =  getleave_in_ggaa(x1, x2)
getleave_out_ggaa(x1, x2, x3, x4)  =  getleave_out_ggaa(x3, x4)
U4_ggaa(x1, x2, x3, x4, x5, x6)  =  U4_ggaa(x6)
U2_gg(x1, x2, x3, x4, x5, x6)  =  U2_gg(x5, x6)
getleave_in_ggga(x1, x2, x3, x4)  =  getleave_in_ggga(x1, x2, x3)
getleave_out_ggga(x1, x2, x3, x4)  =  getleave_out_ggga(x4)
U4_ggga(x1, x2, x3, x4, x5, x6)  =  U4_ggga(x6)
U3_gg(x1, x2, x3, x4, x5)  =  U3_gg(x5)
GETLEAVE_IN_GGAA(x1, x2, x3, x4)  =  GETLEAVE_IN_GGAA(x1, x2)

We have to consider all (P,R,Pi)-chains

(15) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(16) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

GETLEAVE_IN_GGAA(tree(A, B), C, L, O) → GETLEAVE_IN_GGAA(A, tree(B, C), L, O)

R is empty.
The argument filtering Pi contains the following mapping:
tree(x1, x2)  =  tree(x1, x2)
GETLEAVE_IN_GGAA(x1, x2, x3, x4)  =  GETLEAVE_IN_GGAA(x1, x2)

We have to consider all (P,R,Pi)-chains

(17) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(18) Obligation:

Q DP problem:
The TRS P consists of the following rules:

GETLEAVE_IN_GGAA(tree(A, B), C) → GETLEAVE_IN_GGAA(A, tree(B, C))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(19) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • GETLEAVE_IN_GGAA(tree(A, B), C) → GETLEAVE_IN_GGAA(A, tree(B, C))
    The graph contains the following edges 1 > 1

(20) YES

(21) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

U1_GG(T1, T2, S1, S2, getleave_out_ggaa(T1, T2, L, T)) → U2_GG(T1, T2, S1, S2, T, getleave_in_ggga(S1, S2, L, S))
U2_GG(T1, T2, S1, S2, T, getleave_out_ggga(S1, S2, L, S)) → SAMELEAVES_IN_GG(T, S)
SAMELEAVES_IN_GG(tree(T1, T2), tree(S1, S2)) → U1_GG(T1, T2, S1, S2, getleave_in_ggaa(T1, T2, L, T))

The TRS R consists of the following rules:

sameleaves_in_gg(leaf(L), leaf(L)) → sameleaves_out_gg(leaf(L), leaf(L))
sameleaves_in_gg(tree(T1, T2), tree(S1, S2)) → U1_gg(T1, T2, S1, S2, getleave_in_ggaa(T1, T2, L, T))
getleave_in_ggaa(leaf(A), C, A, C) → getleave_out_ggaa(leaf(A), C, A, C)
getleave_in_ggaa(tree(A, B), C, L, O) → U4_ggaa(A, B, C, L, O, getleave_in_ggaa(A, tree(B, C), L, O))
U4_ggaa(A, B, C, L, O, getleave_out_ggaa(A, tree(B, C), L, O)) → getleave_out_ggaa(tree(A, B), C, L, O)
U1_gg(T1, T2, S1, S2, getleave_out_ggaa(T1, T2, L, T)) → U2_gg(T1, T2, S1, S2, T, getleave_in_ggga(S1, S2, L, S))
getleave_in_ggga(leaf(A), C, A, C) → getleave_out_ggga(leaf(A), C, A, C)
getleave_in_ggga(tree(A, B), C, L, O) → U4_ggga(A, B, C, L, O, getleave_in_ggga(A, tree(B, C), L, O))
U4_ggga(A, B, C, L, O, getleave_out_ggga(A, tree(B, C), L, O)) → getleave_out_ggga(tree(A, B), C, L, O)
U2_gg(T1, T2, S1, S2, T, getleave_out_ggga(S1, S2, L, S)) → U3_gg(T1, T2, S1, S2, sameleaves_in_gg(T, S))
U3_gg(T1, T2, S1, S2, sameleaves_out_gg(T, S)) → sameleaves_out_gg(tree(T1, T2), tree(S1, S2))

The argument filtering Pi contains the following mapping:
sameleaves_in_gg(x1, x2)  =  sameleaves_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleaves_out_gg(x1, x2)  =  sameleaves_out_gg
tree(x1, x2)  =  tree(x1, x2)
U1_gg(x1, x2, x3, x4, x5)  =  U1_gg(x3, x4, x5)
getleave_in_ggaa(x1, x2, x3, x4)  =  getleave_in_ggaa(x1, x2)
getleave_out_ggaa(x1, x2, x3, x4)  =  getleave_out_ggaa(x3, x4)
U4_ggaa(x1, x2, x3, x4, x5, x6)  =  U4_ggaa(x6)
U2_gg(x1, x2, x3, x4, x5, x6)  =  U2_gg(x5, x6)
getleave_in_ggga(x1, x2, x3, x4)  =  getleave_in_ggga(x1, x2, x3)
getleave_out_ggga(x1, x2, x3, x4)  =  getleave_out_ggga(x4)
U4_ggga(x1, x2, x3, x4, x5, x6)  =  U4_ggga(x6)
U3_gg(x1, x2, x3, x4, x5)  =  U3_gg(x5)
SAMELEAVES_IN_GG(x1, x2)  =  SAMELEAVES_IN_GG(x1, x2)
U1_GG(x1, x2, x3, x4, x5)  =  U1_GG(x3, x4, x5)
U2_GG(x1, x2, x3, x4, x5, x6)  =  U2_GG(x5, x6)

We have to consider all (P,R,Pi)-chains

(22) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(23) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

U1_GG(T1, T2, S1, S2, getleave_out_ggaa(T1, T2, L, T)) → U2_GG(T1, T2, S1, S2, T, getleave_in_ggga(S1, S2, L, S))
U2_GG(T1, T2, S1, S2, T, getleave_out_ggga(S1, S2, L, S)) → SAMELEAVES_IN_GG(T, S)
SAMELEAVES_IN_GG(tree(T1, T2), tree(S1, S2)) → U1_GG(T1, T2, S1, S2, getleave_in_ggaa(T1, T2, L, T))

The TRS R consists of the following rules:

getleave_in_ggga(leaf(A), C, A, C) → getleave_out_ggga(leaf(A), C, A, C)
getleave_in_ggga(tree(A, B), C, L, O) → U4_ggga(A, B, C, L, O, getleave_in_ggga(A, tree(B, C), L, O))
getleave_in_ggaa(leaf(A), C, A, C) → getleave_out_ggaa(leaf(A), C, A, C)
getleave_in_ggaa(tree(A, B), C, L, O) → U4_ggaa(A, B, C, L, O, getleave_in_ggaa(A, tree(B, C), L, O))
U4_ggga(A, B, C, L, O, getleave_out_ggga(A, tree(B, C), L, O)) → getleave_out_ggga(tree(A, B), C, L, O)
U4_ggaa(A, B, C, L, O, getleave_out_ggaa(A, tree(B, C), L, O)) → getleave_out_ggaa(tree(A, B), C, L, O)

The argument filtering Pi contains the following mapping:
leaf(x1)  =  leaf(x1)
tree(x1, x2)  =  tree(x1, x2)
getleave_in_ggaa(x1, x2, x3, x4)  =  getleave_in_ggaa(x1, x2)
getleave_out_ggaa(x1, x2, x3, x4)  =  getleave_out_ggaa(x3, x4)
U4_ggaa(x1, x2, x3, x4, x5, x6)  =  U4_ggaa(x6)
getleave_in_ggga(x1, x2, x3, x4)  =  getleave_in_ggga(x1, x2, x3)
getleave_out_ggga(x1, x2, x3, x4)  =  getleave_out_ggga(x4)
U4_ggga(x1, x2, x3, x4, x5, x6)  =  U4_ggga(x6)
SAMELEAVES_IN_GG(x1, x2)  =  SAMELEAVES_IN_GG(x1, x2)
U1_GG(x1, x2, x3, x4, x5)  =  U1_GG(x3, x4, x5)
U2_GG(x1, x2, x3, x4, x5, x6)  =  U2_GG(x5, x6)

We have to consider all (P,R,Pi)-chains

(24) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(25) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U1_GG(S1, S2, getleave_out_ggaa(L, T)) → U2_GG(T, getleave_in_ggga(S1, S2, L))
U2_GG(T, getleave_out_ggga(S)) → SAMELEAVES_IN_GG(T, S)
SAMELEAVES_IN_GG(tree(T1, T2), tree(S1, S2)) → U1_GG(S1, S2, getleave_in_ggaa(T1, T2))

The TRS R consists of the following rules:

getleave_in_ggga(leaf(A), C, A) → getleave_out_ggga(C)
getleave_in_ggga(tree(A, B), C, L) → U4_ggga(getleave_in_ggga(A, tree(B, C), L))
getleave_in_ggaa(leaf(A), C) → getleave_out_ggaa(A, C)
getleave_in_ggaa(tree(A, B), C) → U4_ggaa(getleave_in_ggaa(A, tree(B, C)))
U4_ggga(getleave_out_ggga(O)) → getleave_out_ggga(O)
U4_ggaa(getleave_out_ggaa(L, O)) → getleave_out_ggaa(L, O)

The set Q consists of the following terms:

getleave_in_ggga(x0, x1, x2)
getleave_in_ggaa(x0, x1)
U4_ggga(x0)
U4_ggaa(x0)

We have to consider all (P,Q,R)-chains.

(26) UsableRulesReductionPairsProof (EQUIVALENT transformation)

By using the usable rules with reduction pair processor [LPAR04] with a polynomial ordering [POLO], all dependency pairs and the corresponding usable rules [FROCOS05] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

The following dependency pairs can be deleted:

U1_GG(S1, S2, getleave_out_ggaa(L, T)) → U2_GG(T, getleave_in_ggga(S1, S2, L))
U2_GG(T, getleave_out_ggga(S)) → SAMELEAVES_IN_GG(T, S)
SAMELEAVES_IN_GG(tree(T1, T2), tree(S1, S2)) → U1_GG(S1, S2, getleave_in_ggaa(T1, T2))
The following rules are removed from R:

getleave_in_ggga(leaf(A), C, A) → getleave_out_ggga(C)
getleave_in_ggga(tree(A, B), C, L) → U4_ggga(getleave_in_ggga(A, tree(B, C), L))
getleave_in_ggaa(leaf(A), C) → getleave_out_ggaa(A, C)
U4_ggga(getleave_out_ggga(O)) → getleave_out_ggga(O)
U4_ggaa(getleave_out_ggaa(L, O)) → getleave_out_ggaa(L, O)
Used ordering: POLO with Polynomial interpretation [POLO]:

POL(SAMELEAVES_IN_GG(x1, x2)) = x1 + x2   
POL(U1_GG(x1, x2, x3)) = 2 + 2·x1 + x2 + x3   
POL(U2_GG(x1, x2)) = 1 + x1 + x2   
POL(U4_ggaa(x1)) = 2 + x1   
POL(U4_ggga(x1)) = 1 + x1   
POL(getleave_in_ggaa(x1, x2)) = 2·x1 + x2   
POL(getleave_in_ggga(x1, x2, x3)) = 2·x1 + x2 + x3   
POL(getleave_out_ggaa(x1, x2)) = 2 + x1 + x2   
POL(getleave_out_ggga(x1)) = x1   
POL(leaf(x1)) = 2 + 2·x1   
POL(tree(x1, x2)) = 2 + 2·x1 + x2   

(27) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

getleave_in_ggaa(tree(A, B), C) → U4_ggaa(getleave_in_ggaa(A, tree(B, C)))

The set Q consists of the following terms:

getleave_in_ggga(x0, x1, x2)
getleave_in_ggaa(x0, x1)
U4_ggga(x0)
U4_ggaa(x0)

We have to consider all (P,Q,R)-chains.

(28) PisEmptyProof (EQUIVALENT transformation)

The TRS P is empty. Hence, there is no (P,Q,R) chain.

(29) YES